<!DOCTYPE html>
<html lang="en">
<head>

<meta charset="utf-8">
	<title>
		<?php echo $title_for_layout; ?>
	</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="">
	<meta name="author" content="">
	
	<?php echo $this->Html->css(array('bootstrap/css/bootstrap.css', 'bootstrap/css/bootstrap-responsive.css', 'app')) ?>
	<?php echo $this->fetch('css'); ?>
	<style>
		body {
			padding-top: 60px;
		}
	</style>

<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
		<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->

</head>

<body>
	
	<div id="header" class="navbar navbar-fixed-top">
		<div class="container-fluid">
			<a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</a>
			<a href="#" class="brand">Meshtile</a>
			<div class="pull-right">
				<div class="input-prepend">
					<span class="add-on">
						<i class="icon-search"></i>
					</span>
					<input type="text" class="input-xlarge" placeholder="#tag or #user" >
				</div>
				<?php if (AuthComponent::user('uid')) : ?>
					<div class="btn-group">
						<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
							<i class="icon-user"></i>
							<?php echo AuthComponent::user('uid') ?>
							<span class="caret"></span>
						</a>
						<ul class="dropdown-menu">
							<li><a href="#">Profile</a></li>
							<li><a href="#">Statistic</a></li>
							<li class="divider"></li>
							<li>
								<?php echo $this->Html->link('Logout', array('controller' => 'users', 'action' => 'logout')) ?>
							</li>
						</ul>
					</div>
				<?php else : ?>
					<div class="btn-group">
						<?php 
							echo $this->Html->link(
								'<i class="icon-user"></i>&nbsp;Login',
								array('controller' => 'users', 'action' => 'login'),
								array('escape' => false, 'class' => 'btn')
							)
						?>
					</div>
				<?php endif; ?>
			</div>
			<div class="nav-collapse">
				<ul class="nav">
					<li id="home-menu">
						<a href="#"><i class="icon-home"></i></a>
					</li>
					<li id="user-menu">
						<a href="#about"><i class="icon-user"></i></a>
					</li>
					<li id="level-menu">
						<a href="#contact"><i class="icon-star"></i></a>
					</li>
					<li id="setting-menu">
						<a href="#contact"><i class="icon-edit"></i></a>
					</li>
				</ul>
			</div>
		</div>
	</div><!-- // END HEADER -->

	<div id="content" class="container">

<!-- 		<h1>MESHTILE</h1> -->
	
		<?php echo $this->fetch('content'); ?>

	</div><!-- // END CONTENT -->
	
	<div id="footer">
	
	</div><!-- // END FOOTER -->

	<!-- Bootrap javascript
	================================================== -->
	<?php echo $this->Html->script(array('jquery.min')) //, 'bootstrap/bootstrap.min.js' ?>
	<?php echo $this->fetch('script'); ?>

</body>
</html>
